From: Keir Fraser Date: Fri, 15 Jan 2010 08:27:27 +0000 (+0000) Subject: x86: A further fix to xen_in_range(). X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12733 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=4a7e23445795a8a46f5bd1cbc349a3bf0ae726f6;p=xen.git x86: A further fix to xen_in_range(). Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 1c8848e127..5f5be02bbe 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1216,8 +1216,8 @@ int xen_in_range(unsigned long mfn) xen_regions[region_text].s =__pa(&_stext); xen_regions[region_text].e = __pa(&__init_begin); /* per-cpu data */ - xen_regions[region_percpu].s = __pa(&__per_cpu_start); - xen_regions[region_percpu].e = xen_regions[2].s + + xen_regions[region_percpu].s = __pa(__per_cpu_start); + xen_regions[region_percpu].e = xen_regions[region_percpu].s + (((paddr_t)last_cpu(cpu_possible_map) + 1) << PERCPU_SHIFT); /* bss */ xen_regions[region_bss].s = __pa(&__bss_start); @@ -1238,7 +1238,7 @@ int xen_in_range(unsigned long mfn) * freed) section of the per-cpu data space. Each CPU's data * area is page-aligned, so the following arithmetic is safe. */ - unsigned int off = ((start - (unsigned long)__per_cpu_start) + unsigned int off = ((start - __pa(__per_cpu_start)) & (PERCPU_SIZE - 1)); unsigned int data_sz = __per_cpu_data_end - __per_cpu_start; return off < data_sz;